package com.freshmarket.freshmarket.dao;

import com.freshmarket.freshmarket.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Squirrel
 * @since 2020-09-04
 */
public interface UserMapper extends BaseMapper<User> {

    //通过电话判断用户是否已经存在
    public User selectByPhone(@Param("userPhone") String userPhone)throws Exception;
    //新增用户
    public int insertUser(@Param("userName") String userName,@Param("userPhone") String userPhone,@Param("userPassword") String userPassword)throws Exception;
    //记录当前用户的登录时间
    public int updateTime(@Param("userPhone") String userPhone,@Param("userLastLogintime") String userLastLogintime) throws Exception;
    //积分兑换，减少用户积分
    //public int updateScore(@Param("userId") Integer userId,@Param("userScore") Integer userScore) throws Exception;
}
